<?php
Route::domain(env('WX_DOMAIN'))->name('wx.')->group( function () {

	Route::get('login', 'Weixin\WxController@login')->name('login');
	Route::post('login', 'Weixin\WxController@postLogin');
	Route::get('reg', 'Weixin\WxController@reg')->name('reg');
	Route::post('reg', 'Weixin\WxController@postReg');
	Route::post('sms', 'Weixin\WxController@sms')->name('sms');
	Route::post('csms', 'Weixin\WxController@csms')->name('csms');
	Route::get('books', 'Weixin\WxController@books')->name('books');

	Route::get('covid', 'Weixin\WxController@covid')->name('covid');

	Route::middleware('auth')->group( function () {

		Route::get('/', 'Weixin\WxController@index')->name('index');
		Route::get('logout', 'Weixin\WxController@logout')->name('logout');

		Route::get('deploy/{type}', 'Weixin\WxController@deploy')->name('deploy');
		Route::post('deploy/sign', 'Weixin\WxController@sign')->name('sign');

		//获取报名备注事项
	    Route::get('memo/{id}', 'Weixin\WxController@claseMemo')->name('memo');

		Route::prefix('my')->name('my.')->group( function () {
			Route::get('activity', 'Weixin\MyController@myActivity')->name('activity');
			Route::get('point', 'Weixin\MyController@myPoint')->name('point');
			Route::get('borrow', 'Weixin\MyController@myBorrow')->name('borrow');
			Route::get('question', 'Weixin\MyController@myQuestion')->name('question');
			Route::post('question', 'Weixin\MyController@postQuestion');
			Route::get('deploy', 'Weixin\MyController@myDeploy')->name('deploy');
			Route::get('book', 'Weixin\MyController@myBook')->name('book');
			Route::post('cancel', 'Weixin\MyController@myCancel')->name('cancel');
			Route::get('attachment/{id}', 'Weixin\MyController@myAttachment')->name('attachment');
			Route::post('attachment/add', 'Weixin\MyController@postAttachmentAdd')->name('attachment.add');
			Route::post('attachment/remove', 'Weixin\MyController@postAttachmentRemove')->name('attachment.remove');
			//信息和手机号码修改 added at 20210713
			Route::get('info', 'Weixin\MyController@myInfo')->name('info');
			Route::post('info', 'Weixin\MyController@postInfo');
			Route::get('mobile', 'Weixin\MyController@myMobile')->name('mobile');
		});

	});

	/**
	 * 花名册
	 */
	Route::prefix('settle')->name('settle.')->group( function () {
		Route::get('login', 'Weixin\SettleController@login')->name('login');
		Route::post('login', 'Weixin\SettleController@postLogin');
		Route::get('reg', 'Weixin\SettleController@reg')->name('reg');
		Route::post('reg', 'Weixin\SettleController@postReg');

		//征文
		Route::get('recruit', 'Weixin\SettleController@recruit')->name('recruit');
		Route::post('recruit', 'Weixin\SettleController@recruitPost');
		//答题
		Route::get('quiz', 'Weixin\SettleController@quiz')->name('quiz');
		Route::post('quiz', 'Weixin\SettleController@quizPost');

		Route::get('resist', 'Weixin\SettleController@resist')->name('resist');
		Route::post('resist', 'Weixin\SettleController@resistPost');

		Route::middleware('auth.settle')->group( function () {
			Route::get('index', 'Weixin\SettleController@index')->name('index');
			Route::get('logout', 'Weixin\SettleController@logout')->name('logout');

			Route::get('confirm/{id}', 'Weixin\SettleController@confirm')->name('confirm');
			Route::post('student', 'Weixin\SettleController@student')->name('student');
		});
	});

	//专题活动
	Route::prefix('act')->name('act.')->group( function () {
		Route::get('topic/{uuid}', 'Weixin\ActController@topic')->name('topic');
		Route::post('answer', 'Weixin\ActController@answer')->name('answer');
	});

});